package org.moonshot.cvm;

public class CVMArray implements I_ChattyCompatible
{
	private final Object[] array;
	
	public CVMArray(ChattyVM aVM, int len)
	{
		array = new Object[len];
		for(int i = 0; i < len; i++)
			array[i] = aVM.NIL;
	}
	
	public Object[] getJavaArray ()
	{
		return array;
	}
	
	public Object get(int idx)
	{
		return array[idx];
	}
	
	public int getLength ()
	{
		return array.length;
	}
	
    public I_ChattyClass identifySelfClass (ChattyVM aVM)
    {
	    return aVM.classFor (CVMArrayClass.class);
    }
}
